<html xmlns:th="http://www.springframework.org/schema/data/jaxb">
<head>
    <title>Reading List</title>
    <link rel="stylesheet" th:href="@{/style.css}"/>
    <meta name="_csrf" th:content="${_csrf.token}"/>
    <meta name="_csrf_header" th:content="${_csrf.headerName}"/>
</head>

<body>
<h2>Your Reading List</h2>
<div th:unless="${#lists.isEmpty(books)}">
    <dl th:each="book : ${books}">
        <dt class="bookHeadline">
            <span th:text="${book.title}">Title</span> by
            <span th:text="${book.author}">Author</span>
            (ISBN: <span th:text="${book.isbn}">ISBN</span>)

        </dt>
        <dd class="bookDescription">
          <span th:if="${book.description}"
                th:text="${book.description}">Description</span>
            <span th:if="${book.description eq null}">
                No description available</span>
        </dd>
    </dl>
</div>
<div th:if="${#lists.isEmpty(books)}">
    <p>You have no books in your book list</p>
</div>

<hr/>

<h3>Add a book  好奇怪呀</h3>
<form method="POST">
    <label >Title:</label>
    <input type="text" name="title" size="50"></input><br/>
    <label >Author:</label>
    <input type="text" name="author" size="50"></input><br/>
    <label >ISBN:</label>
    <input type="text" name="isbn" size="15"></input><br/>
    <label >Description:</label><br/>
    <textarea name="description" cols="80" rows="5">
        </textarea><br/>
    <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}" />
    <input type="submit"></input>

  </form>

</body>
</html>